from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.edge.service import Service
from webdriver_manager.microsoft import EdgeChromiumDriverManager

#1.打开浏览器--驱动管理
EdgeIns=EdgeChromiumDriverManager().install()
#创建浏览器驱动对象
driver=webdriver.Edge(service=Service(EdgeIns))

#2.输入百度网址
driver.get("https://www.baidu.com")

#3.找到百度输入框，输入关键字
driver.find_element(By.CSS_SELECTOR,"#kw").send_keys("网易")

#4.点击百度一下按钮
driver.find_element(By.CSS_SELECTOR,"#su").click()

driver.find_element(By.CSS_SELECTOR,"#su").get_attribute("value")

#5.关闭浏览器
driver.quit()